package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.List;

/**
 * 角色实体类
 */
@TableName("t_role")
public class RoleBean {
    /**
     * 角色id
     */
    @TableId(value = "pk_roleId",type = IdType.AUTO)
    private int id;
    /**
     * 角色名称
     */
    @TableField("r_name")
    private String name;
    /**
     * 权限集合
     */
    @TableField(exist = false)
    private List<GradeBean> gradeBeanList;

    public RoleBean() {
    }

    public RoleBean(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<GradeBean> getGradeBeanList() {
        return gradeBeanList;
    }

    public void setGradeBeanList(List<GradeBean> gradeBeanList) {
        this.gradeBeanList = gradeBeanList;
    }

    @Override
    public String toString() {
        return "RoleBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gradeBeanList=" + gradeBeanList +
                '}';
    }
}
